package com.yw.directory.domain;

/**
 * @author taj
 * @version 1.0
 */

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

/**
 * 总表实体类
 */
@Schema(description = "总表")
@Table(name = "directory")
@Data
public class Directory {

    /**
     * 内码，主键，自增长
     */
    @Id
    @Schema(name = "id", description = "总表id")
    private Integer id;

    /**
     * 目录名，主键，必填，最大长度30
     */
    @NotBlank(message = "目录名不能为空")
    @Schema(name = "name", description = "目录名")
    @TableField("directory_name")
    private String name;

    /**
     * 父级id，必填
     */
    @Schema(name = "parentId", description = "父级id")
    private Integer parentId;
}

